<div class="ui-bar  ui-widget ui-widget-content ui-corner-all">
<a class="ui-button ui-widget-content ui-state-default ui-corner-all" href="<?php
            echo $this->url(
                array('module' => 'default',
                      'controller'=>'user',
                      'action'=>'add'),
                'default', true)
                ?>"
                ><?php echo  $this->translate('Add user'); ?></a>
</div>

<div class="ui-grid ui-widget ui-widget-content ui-corner-all">
<div class="ui-grid-header ui-widget-header ui-corner-top"><?php echo  $this->translate('Users'); ?></div>
<table class="ui-grid-content ui-widget-content" >
<thead>
    <tr>
        <th class="ui-state-default">
            <a href="<?php echo $this->url(array('module' => 'default',
                                                 'controller'=>'user',
                                                 'action'=>'admin',
                                                 'sort'=>'u.first_name'))?>">
                <span class="ui-icon ui-icon-triangle-1-s" title="sort ascending"></span>
                <?php echo $this->translate('First name'); ?>
            </a>
        </th>
        <th class="ui-state-default">
            <a href="<?php echo $this->url(array('module' => 'default',
                                                 'controller'=>'user',
                                                 'action'=>'admin',
                                                 'sort'=>'u.last_name'))?>">
                <span class="ui-icon ui-icon-triangle-1-s" title="sort ascending"></span>
                <?php echo $this->translate('Last name'); ?>
            </a>
        </th>
        <th class="ui-state-default">
            <a href="<?php echo $this->url(array('module' => 'default',
                                                 'controller'=>'user',
                                                 'action'=>'admin',
                                                 'sort'=>'u.email'))?>">
                <span class="ui-icon ui-icon-triangle-1-s" title="sort ascending"></span>
                <?php echo $this->translate('Email'); ?>
            </a>
        </th>
        <th class="ui-state-default">
            <a href="<?php echo $this->url(array('module' => 'default',
                                                 'controller'=>'user',
                                                 'action'=>'admin',
                                                 'sort'=>'u.created_at'))?>">
                <span class="ui-icon ui-icon-triangle-1-s" title="sort ascending"></span>
                <?php echo $this->translate('Created at'); ?>
            </a>
        </th>
        <th class="ui-state-default"><?php echo $this->translate('Edit'); ?></th>
    </tr>
</thead>
<tbody>
    <?php if(count($this->users)): foreach($this->users as $user):?>
    <tr>
        <td class="ui-widget-content"><?php echo $user['first_name']; ?></td>
        <td class="ui-widget-content"><?php echo $user['last_name']; ?></td>
        <td class="ui-widget-content"><?php echo $user['email']; ?> ( <?php echo $user['password']; ?> )</td>
        <td class="ui-widget-content"><?php echo $user['created_at']; ?></td>
        <td class="ui-widget-content">
        <a href="<?php
            echo $this->url(array('module' => 'default',
                                  'controller'=>'user',
                                  'action'=>'update-password',
                                  'user_id'=>$user['id']),
                'default', true)
                ?>"><?php echo  $this->translate('Update password'); ?></a>

        <a href="<?php
            echo $this->url(array('module' => 'default',
                                  'controller'=>'user',
                                  'action'=>'edit',
                                  'user_id'=>$user['id']),
                'default', true)
                ?>"><?php echo  $this->translate('Edit'); ?></a>

            <a href="<?php
            echo $this->url(array('module' => 'default',
                                  'controller'=>'user',
                                  'action'=>'delete',
                                  'user_id'=>$user['id']),
                'default', true)
                ?>"><?php echo  $this->translate('Delete'); ?></a>
        </td>
    </tr>
    <?php endforeach;  else:  ?>
    <tr>
        <td class="ui-widget-content ui-grid-empty" colspan="5">
            <?php echo $this->translate('No users'); ?>
        </td>
    </tr>
    <?php endif;?>
    </tbody>
</table>

<div class="ui-grid-footer ui-widget-header ui-corner-bottom ui-helper-clearfix">
    <?php echo $this->paginationControl($this->users); ?>
</div>
</div>

